﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WorkSpace.Core
{
    public interface IWorkSpaceService
    {
        bool SaveCategory(Category category);
        List<Category> FindCategories(string account);


        bool SaveLink(Link link);

        /// <summary>
        /// 获取上级的连接
        /// </summary>
        /// <param name="account"></param>
        /// <returns></returns>
        List<Link> FindInheritedLinks(string account);
        /// <summary>
        /// 获取自己创建的连接
        /// </summary>
        /// <param name="account"></param>
        /// <returns></returns>
        List<Link> FindPrivateLinks(Guid categoryId, string account);
        Link FindLink(Guid linkId);

        /// <summary>
        /// 获取所有可用的连接
        /// </summary>
        /// <param name="account"></param>
        /// <returns></returns>
        List<Link> FindAllLinks(string account);

        /// <summary>可以用的链接
        /// 获取该类别所有
        /// </summary>
        /// <param name="categoryId"></param>
        /// <param name="account"></param>
        /// <returns></returns>
        List<Link> FindAllLinks(Guid categoryId, string account);

        bool SavePersonalPackage(PersonalPackage package);
        bool RemovePersonalPackage(Guid packageId);
        bool AddPersonalLink(PersonalPackage package, Guid linkId);
        bool RemovePersonalLink(PersonalPackage package, Guid linkId);
        bool ClearPersonalLinks(PersonalPackage package);
        PersonalPackage FindPersonalPackage(Guid packageId);
        List<PersonalPackage> FindPersonalPackages(Guid categoryId, string account);
        List<PersonalLink> FindPersonalLinks(Guid packageId, string account);
        List<Category> FindPersonalCategories(string account);

        bool SaveIcon(IconData icon);
        IconData FindIcon(Guid id);
        List<IconData> FindIcons();
    }
}
